<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link rel="stylesheet" type="text/css" href="../../css/style.css" />
</head>
<script type="text/javascript" src="../js/httpRequest.js"></script>
<script type="text/javascript">
//로그아웃처리
//로그아웃처리#1
function logout(){
	sendRequest("../ajax/login_check.jsp", 
			"login="+ "off", resultLogoff, "POST");
	
}
////로그아웃처리처리#2
function resultLogoff() {
	
	if (xhr.readyState == 4 && xhr.status == 200) {
			var log_out = document.getElementById("log_out");
			var log_on = document.getElementById("log_on");
			log_out.style.display='block';
			log_on.style.display='none';
			login_table.id.value="";
			login_table.pwd.value="";
	}
	location.href="../main/main.do";
}

function inform(){
	location.href="../main/inform.do";
}




</script>

<body>
<div id="header">
		<div id="logo">
			<h1>
				<a href="#" style="color: white;">Fast Safe Fire Evacuation</a>
			</h1>
		</div>
		<div id="search">
			<form action="" method="post">
				<div>
					<input class="text" name="search" size="32" maxlength="64" />
				</div>
			</form>
		</div>
		<div id="menu">
			<ul>
				<li class="first active">
					<a href="../main/main.do?">Home</a>
				</li>
				<li>
					<a href="../main/community_main.do?menu_no=2&cate_no=6&title_no=0&state=list">Community</a>
				</li>
				
					
				<li>
					<a href="#">About</a>
				</li>
				
				<li>
				<c:if test="${alias=='admin'}">
					<a href="../community/admin.do?x_id=1">ADMIN</a>
	        	</c:if>
				</li>
				
			</ul>
		</div>
	</div>
	<div id="title">
		<div id="title_img">
			<div id="login">
				<div id='log_out' style="display:none;">
					<form id=login_table>
						<table>
							<tr>
								<td >ID</td>
								<td colspan="2"><input type="text" name="id" id="id"></td>
								<td rowspan="2"><input type="button"  class ="pink_button" value="로그인" style="width: 50px; height: 50px;"></td>
							</tr>
							<tr>
								<td>PWD</td>
								<td colspan="2"><input type="password" name="pwd" id="pwd"></td>
							</tr>
							
							<tr>
								<td colspan="2">
								<a href="../main/community_main.do?state=id_pw&menu_no=3">
								<input type="button" class ="pink_button" value="ID/PWD찾기"></a></td>
								<td colspan="2">
								<a href="../main/community_main.do?state=join&menu_no=3">
								<input type="button" class ="pink_button"  value="회원가입"/></a> </td>
							</tr>
						</table>
					</form>
				</div>
				
				
				<div id="log_on">
					<table>
				<tr>
					<td colspan="2" style="color: silver;">${alias}님 환영합니다!!
					<c:if test="${grade =='1' }">
					<img src="../img/grade1.JPG" width="25" height="25">
					</c:if>
					<c:if test="${grade =='2' }">
					<img src="../img/grade2.JPG" width="25" height="25">
					</c:if>
					<c:if test="${grade =='3' }">
					<img src="../img/grade3.JPG" width="25" height="25">
					</c:if>
					<td>
				</tr>
				<tr>
					<td><input type="button" class ="pink_button" value="로그아웃" onclick="logout()"></td>
					<td>
					<input type="button" class ="pink_button" value="회원정보" onclick="inform()"/>
					</td>
				</tr>
			</table>
				</div>
			</div>
		</div>
	</div>
</body>
</html>